package cn.wolfcode.crm.serivce.impl;

import cn.wolfcode.crm.domain.ClassifyChild;
import cn.wolfcode.crm.mapper.ClassifyChildMapper;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.serivce.IClassifyChildService;
import cn.wolfcode.crm.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ClassifyChildServiceImpl implements IClassifyChildService{
    @Autowired
    private ClassifyChildMapper mapper;

    @Override
    public void deleteByPrimaryKey(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    @Override
    public void saveOrUpdate(ClassifyChild record) {
        if (record.getLinkId() == null) {
            //保存操作
            mapper.insert(record);
        }else {
            mapper.updateByPrimaryKey(record);
        }
    }

    @Override
    public ClassifyChild selectByPrimaryKey(Long id) {
        return mapper.selectByPrimaryKey(id);
    }

  

    @Override
    public List<ClassifyChild> selectAll() {
        return mapper.selectAll();
    }

    @Override
    public void deleteByclassNumber(Integer classNumber) {
        mapper.deleteByclassNumber(classNumber);
    }
}
